#pragma once
#include "Mapper.h"
#include "Mapper000.h"
#include "Mapper001.h"
#include "Mapper002.h"
#include "Mapper003.h"
#include "Mapper004.h"
#include "Mapper007.h"
#include "Mapper066.h"
#include "Mapper074.h"
#include "Mapper076.h"
#include "Mapper245.h"

#define SUPPORTMAPPER(X) case X: return (Mapper*)new Mapper###X();

class MapperFactory {
public:
	static Mapper* Factory(Famicom * famicom, const uint8_t mapper)
	{
		switch (mapper)
		{
		case 0:
			return (Mapper*)new Mapper000(famicom);
		case 1:
			return (Mapper*)new Mapper001(famicom);
		case 2: 
			return (Mapper*)new Mapper002(famicom);
		case 3: 
			return (Mapper*)new Mapper003(famicom);
		case 4: 
			return (Mapper*)new Mapper004(famicom);
		case 7: 
			return (Mapper*)new Mapper007(famicom);
		case 66: 
			return (Mapper*)new Mapper066(famicom);
		case 74:
			return (Mapper*)new Mapper074(famicom);
		case 76:
			return (Mapper*)new Mapper076(famicom);
		case 245:
			return (Mapper*)new Mapper245(famicom);
		default:
			return nullptr;
		}
	}

};